<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>axios post</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id='app'>
        <ul>
            <li v-for="item in list">
                {{item}}
            </li>
        </ul>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                list:null
            },
            created() {
                let body = {
                    dictType: 'blogroll',
                    pageNum: 1,
                    pageSize: 5,
                    orderByColumn: 'createTime',
                    isAsc: 'desc'
                }

                let options = {
                     emulateJSON: true,
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                }

                // js内置的formdata的对象
                // const formData = new FormData()
                // formData.append("dictType", "blogroll");
                // formData.append("pageNum", "1");
                // formData.append("pageSize", "5");
                // formData.append("orderByColumn", "createTime");
                // formData.append("isAsc", "desc");


                let param = new URLSearchParams();
                param.append('dictType','blogroll')                
                param.append('pageNum','1')                
                param.append('pageSize','5')                
                param.append('orderByColumn','createTime')                
                param.append('isAsc','desc')                

                axios.post('http://59.111.104.104:8086/system/dict/data/list/open', param, options).then(
                    res => {
                        debugger
                        this.list = res.data.data
                    })
            },
        })
    </script>
</body>

</html>